const MongoClient = require('mongodb').MongoClient;
const Config = require('./Config');

class Global {
    static db;
    static async init() {
        const client = await new MongoClient(Config.mongo_db).connect();
        this.db = client.db()
    }
    static collection(col) {
        return this.db.collection(col)
    }
}

module.exports = Global